package com.kumi.crowd.controller;

import com.kumi.crowd.bean.Admin;
import com.kumi.crowd.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class TestController {

    @Autowired
    private AdminService adminService;

    @RequestMapping("index")
    public String index(){
        return "index";
    }

    @RequestMapping("/test/ssm")
    public String test(Model model){
        List<Admin> list = adminService.getAll();
        model.addAttribute("list",list);
        return "tager";
    }

    @RequestMapping("send/array")
    public String test(@RequestBody List<Integer> list){
        for (Integer integer : list) {
            System.out.println(integer);
        }
        return "tager";
    }
}
